<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/PersonnelManagement' }">系统设置</el-breadcrumb-item>
      <el-breadcrumb-item>人员管理</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card>
      日期
      <el-date-picker
        class="dataPiker"
        v-model="date"
        type="date"
        placeholder="选择日期"
      >
      </el-date-picker>
      <el-button
        class="dateBtn"
        @click="search"
        icon="el-icon-search"
        type="primary"
        >搜索</el-button
      >
      <el-button
        class="dateBtn"
        @click="deletedDate"
        icon="el-icon-delete"
        type="danger"
        >删除</el-button
      >
    </el-card>

    <el-card>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="date" label="日期" width="180">
        </el-table-column>
        <el-table-column prop="name" label="姓名" width="180">
        </el-table-column>
        <el-table-column prop="address" label="地址"> </el-table-column>
         <el-table-column label="操作" prop="">
          <template slot-scope="scope">
            <el-row>
              <el-button
                type="primary"
                icon="el-icon-edit"
                size="mini"
                @click="EidtTableRow(scope.row.id)"
                >编辑</el-button
              >
              <el-button
                type="danger"
                icon="el-icon-delete"
                size="mini"
                @click="deleteTableRow(scope.row.id)"
                >删除</el-button
              >
            </el-row>
          </template>
        </el-table-column>
      </el-table>
      <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage4"
      :page-sizes="[100, 200, 300, 400]"
      :page-size="100"
      layout="total, sizes, prev, pager, next, jumper"
      :total="400">
    </el-pagination>
  </div>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      date: "",
      currentPage4:0,
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄",
        },
      ],
    };
  },
  methods: {
    //仅仅定义
    search(){

    },
    deletedDate(){

    },
    handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
      },
    EidtTableRow(row) {
      this.$router.push({
        path:'/personnelEdit'
      })
    }
  }
};
</script>

<style scoped>
.dateBtn {
  margin-left: 20px;
}
.el-card {
  margin-bottom: 20px;
}
.block {
  margin-top: 20px;
}
</style>
